var Event = Class.extend({
    init : function() {
        this.pools   = [];
        this.eventer = {};
    },

    on : function(ev, fn) {
        this.pools.push({ev : ev, fn : fn});
        $(this.eventer).on(ev, fn);
    },

    off : function(ev) {
        if (typeof(ev) == 'undefined' || ev === null) {
            this.pools = [];
            $(this.eventer).off();

            return true;
        }

        $(this.eventer).off(ev);
        var _this = this;

        $.each(this.pools, function(k, v) {
            if (typeof(v) == 'undefined') {
                return ;
            }

            if (v.ev == ev) {
                delete _this.pools[k];
            }
        })
    },

    trigger : function(ev, param) {
        $(this.eventer).trigger(ev, param);
    }
});
